/*
 ============================================================================
 Name		: FEAppView.h
 Author	    : Junjie Qu
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CFEAppEditerView declaration
 ============================================================================
 */

#ifndef FEAPPEDITERVIEW_H
#define FEAPPEDITERVIEW_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <aknview.h>

#include "FETimer.h"
#include "FEAutoSave.h"
#include "FEEditor.h"

class CFEAppEditerContainer;

// CLASS DECLARATION

/**
 *  CFEAppEditerView
 * 
 */
class CFEAppEditerView : public CAknView, public MFEAutoSave
{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CFEAppEditerView();

	/**
	 * Two-phased constructor.
	 */
	static CFEAppEditerView* NewL();

	/**
	 * Two-phased constructor.
	 */
	static CFEAppEditerView* NewLC();

public:
	// Functions from base classes
	TUid Id() const;
	void HandleCommandL(TInt aCommand);
	void HandleClientRectChange();

private:

	/**
	 * Constructor for performing 1st stage construction
	 */
	CFEAppEditerView();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL();

	void DoActivateL(const TVwsViewId& aPrevViewId, TUid aMessageId,
			const TDesC8 &aFileName);
	void DoDeactivate();

	void NewFileL();
	void OpenFileL();
	void SaveFileL();
	void SaveAsFileL();
	void ConfirmToSaveL();
	void SetPrePath(TFileName &aPrePath);

	//from class MFEAutoSave
	void AutoSaveL();

private:
	//data
	CFEAppEditerContainer* iContainer;
	CFEEditor *iEditer;
	TFileName iFileName;
	TFileName iPrePath;
	TBool iFileExist;

	CFETimer *iFETimer;
};

#endif // FEAPPVIEW_H
